package com.sean.String;

public class Main {

    public static void main(String[] args) {
   /*     String string1 = "aaaaa";

        String string2 = string1+"bbbbb";
        StringBuffer buffer = new StringBuffer();
        buffer.append("aaaa");
        String.
        System.out.println(buffer.toString());

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("aaaaa");
        System.out.println(stringBuilder.toString());*/

        String str1 = "a";
        String str2 = "b";
        String str3 = "ab";
        String str4 = str1 + str2;
        String str5 = new String("ab");

        System.out.println(str5.equals(str3));
        System.out.println(str5 == str3);
        System.out.println(str4 == str3);
        System.out.println(str5.intern() == str3);
        System.out.println(str5.intern() == str4);
    }
}
